package perf.data;

public class Sourcefile extends BaseItem<Function,Binary> {

	public Sourcefile( String path ) {
		super( path );
	}
	
	public long getCost(int costidx ) {
		long cost = 0;
		for ( Function f : siblings() ) {
			cost += f.getCost(costidx);
		}
		return cost;
	}
	
	public Function getFunctionInstance( String name ) {
		Function f = findSibling( name );
		
		if ( f != null ) {
			return f;
		} else {
			return add( new Function( name ) );
		}
	}
}
